/*
 * Copyright 2007 The semap project development team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Created by myn at 07.08.2007 17:03:22.
 *
 * TODO <<insert description>>.
 *
 * $Id: StringMaker.java 382 2007-08-16 21:01:36Z falexg $
 */
package com.google.code.contactserv.common.makers;

public class StringMaker {

    public static boolean isRegEx(String str) {
        char symbRegEx[] = {'*', '.', '^', '[', ']', '$', '\\', '(', ')', '+', '?', '|'};

        for (char aSymbRegEx : symbRegEx) {
            if (str.indexOf(aSymbRegEx) >= 0) return true;
        }
        return false;
    }

    public static String cleanQuote(String str) {
        final StringBuffer buffer = new StringBuffer();

        final int from = str.indexOf('\'');
        if (from >= 0) {
            return buffer.append(str.substring(from+1, str.lastIndexOf('\''))).toString();
        }
        return str;
    }
}
